﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PUCP.SI2.SGIRP.BE;
using PUCP.SI2.SGIRP.BC;

namespace PUCP.SI2.SGIRP.GUI
{
    public partial class MantenimientoCCForm : Form
    {
        List<CentroComercialBE> listaCC = new List<CentroComercialBE>();
        CentroComercialBE selectCC = null;
        public MantenimientoCCForm()
        {
            InitializeComponent();
            refreshTable();
        }

        public void refreshTable()
        {
            dgvCC.Rows.Clear();
            listaCC = CentroComercialBC.getAllCC();

            for (int i = 0; i < listaCC.Count; i++)
            {
                dgvCC.Rows.Add("" + listaCC[i].Abreviatura, "" + listaCC[i].Nombre, listaCC[i].Direccion);
            }

            dgvCC.AutoResizeColumns();
            dgvCC.AutoResizeRows();

        }

        private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            //EditarCCForm editarCC = new EditarCCForm();
            //editarCC.ShowDialog(this);
        }

        private void tsbAgregar_Click(object sender, EventArgs e)
        {
            AgregarCCForm agregarCC = new AgregarCCForm();
            agregarCC.ShowDialog(this);
        }

        private void tsbMostrar_Click(object sender, EventArgs e)
        {
            //new MostrarCCForm().Show();
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void tsbEliminar_Click(object sender, EventArgs e)
        {
            if (selectCC != null)
            {

            }
        }
    }
}
